<?php
	/**
	 * 商品表关联模型
	 */
	class GoodsRelationModel extends RelationModel{

		//用这个表和下方定义的表进行关联
		protected $tableName = 'goods';
		//定义关联关系
		protected $_link = array(
			'goods_attr' => array(
				'mapping_type' => HAS_MANY,
				'foreign_key' => 'gid'
				),
			'intro' => array(
				'mapping_type' => HAS_ONE,
				'foreign_key' => 'gid'
				)
			);
	}
?>